﻿Public Class SearchForm
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Form1.Search(TextBox1.Text, RadioButton2.Checked)
    End Sub

    Private Sub SearchForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        If Form1.NodesTreeView.SelectedNode Is Nothing Then
            Return
        End If
        TextBox1.Text = Form1.NodesTreeView.SelectedNode.Text
    End Sub

    Private Sub SearchForm_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
        If e.KeyValue = Keys.Escape Then
            Hide()
        End If
    End Sub

    Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged

    End Sub

    Private Sub TextBox1_KeyDown(sender As Object, e As KeyEventArgs) Handles TextBox1.KeyDown
        If e.KeyValue = Keys.Enter Then
            Button1_Click(Nothing, Nothing)
        End If
    End Sub
End Class